<template>
  <div class="users-container">
    <h4 class="text-center">用户管理</h4>
    <!-- 用户列表 -->
    <table border style="width: 100%; border-collapse: collapse; margin-top: 20px;">
      <thead>
        <tr style="background: #f5f5f5;">
          <th style="padding: 12px; border: 1px solid #ddd; text-align: center;">编号</th>
          <th style="padding: 12px; border: 1px solid #ddd; text-align: center;">姓名</th>
          <th style="padding: 12px; border: 1px solid #ddd; text-align: center;">等级</th>
          <th style="padding: 12px; border: 1px solid #ddd; text-align: center;">操作</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="(item, i) in userlist" :key="item.id" style="background: #fff;">
          <td style="padding: 12px; border: 1px solid #ddd; text-align: center;">{{ item.id }}</td>
          <td style="padding: 12px; border: 1px solid #ddd; text-align: center;">{{ item.name }}</td>
          <td style="padding: 12px; border: 1px solid #ddd; text-align: center;">{{ item.level }}</td>
          <td style="padding: 12px; border: 1px solid #ddd; text-align: center;">
            <router-link :to="'/home/users/' + item.id" style="color: #3498db; text-decoration: none;">详情</router-link>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</template>

<script setup>
// 模拟用户数据
const userlist = [
  { id: '1', name: '小明', level: '一级客户' },
  { id: '2', name: '小红', level: '二级客户' },
  { id: '3', name: '小兰', level: '三级客户' },
  { id: '4', name: '小芳', level: '四级客户' }
]
</script>

<style scoped>
.users-container {
  width: 100%;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
}

.text-center {
  text-align: center;
  color: #333;
  margin: 0;
}
</style>